<?php
include_once("../config.php");
$dwid=$_GET['dwid'];
$name=$_GET['name'];
$tel=$_GET['tel'];

$sql = "select id from user where tel='$tel'";
$requ = mysqli_query($con,$sql);
if(mysqli_num_rows($requ)){
	die('{"status":"0","msg":"电话已存在"}');
}else{
	$sql = "insert into user (openid, username, password, juese, status, ming, tel, danwei, qianming) values 
			('', '$tel', '', 3, 1, '$name', '$tel', $dwid, '')";
	mysqli_query($con,$sql);
	if(mysqli_insert_id($con)){
		die('{"status":"1","msg":"ok"}');
	}else{
		die('{"status":"-1","msg":"请重试"}');
	}
}




